<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head(title)">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title th:replace="${title}">博客中心</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" th:href="@{~/static/bower_components/bootstrap/dist/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{~/static/bower_components/font-awesome/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{~/static/bower_components/Ionicons/css/ionicons.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{~/../static/dist/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" th:href="@{~/static/dist/css/skins/_all-skins.min.css}">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>

<!--在使用时，记得先使用<body>标签，否则没有主题样式-->
<body class="hold-transition skin-blue sidebar-mini">
<nav th:fragment="left-menu">
    <!--<head>-->
    <header class="main-header">
        <!-- Logo -->
        <a href="index.html" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>blog</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>博客中心</b>-weblog</span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- Messages: style can be found in dropdown.less-->
                    <li class="dropdown messages-menu" th:if="${login}">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-envelope-o"></i>
                            <!--<span class="label label-success">4</span>-->
                        </a>
                        <ul class="dropdown-menu">
                            <!--动态获取消息数量-->
                            <li class="header">You have 4 messages</li>
                            <li>
                                <!-- inner menu: contains the actual data -->
                                <ul class="menu">
                                    <li><!-- start message -->
                                        <a href="#">
                                            <div class="pull-left">
                                                <img src="/static/img/default-head.jpg" class="img-circle" alt="User Image">
                                            </div>
                                            <!--利用each进行遍历-->
                                            <h4>
                                                Support Team
                                                <small><i class="fa fa-clock-o"></i> 5 mins</small>
                                            </h4>
                                            <p>Why not buy a new awesome theme?</p>
                                        </a>
                                    </li>
                                    <!-- end message -->
                                </ul>
                            </li>
                            <li class="footer"><a href="#">See All Messages</a></li>
                        </ul>
                    </li>
                    <!-- User Account: style can be found in dropdown.less -->
                    <li class="dropdown user user-menu">
                        <a th:if="${login}" href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img src="/static/img/default-head.jpg" class="user-image" alt="User Image">
                            <span class="hidden-xs" th:text="${session.user.username}">User</span>
                        </a>
                        <a th:if="!${login}" th:href="@{/user}" class="dropdown-toggle" data-toggle="dropdown">
                            <span class="hidden-xs" onclick="window.location.href='/user'">登录</span>
                        </a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
</nav>


<footer th:fragment="footer"  class="main-footer">
    <div class="pull-right hidden-xs" style="margin-right:30px">
        <b>Student</b> 201810214719
    </div>
    <strong style="margin-left: 30px">lena<a th:href="@{/user}" style="margin-left: 10px">个人博客</a></strong>
</footer>

<!--使用thymeaf可以引入资源-->
<th:block th:fragment="script">
    <!-- jQuery 3 -->
    <script th:src="@{~/static/bower_components/jquery/dist/jquery.min.js}"></script>
    <!-- Bootstrap 3.3.7 -->
    <script th:src="@{~/static/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>
    <!-- SlimScroll -->
    <script th:src="@{~/static/bower_components/jquery-slimscroll/jquery.slimscroll.min.js}"></script>
    <!-- FastClick -->
    <script th:src="@{~/static/bower_components/fastclick/lib/fastclick.js}"></script>
    <!-- AdminLTE App -->
    <script th:src="@{~/static/dist/js/adminlte.min.js}"></script>
    <!-- AdminLTE for demo purposes -->
    <script th:src="@{~/static/dist/js/demo.js}"></script>
</th:block>

</body>

</html>